package com.service.single.example.ldap;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.ldap.odm.annotations.Attribute;
import org.springframework.ldap.odm.annotations.Entry;
import org.springframework.ldap.odm.annotations.Id;

import javax.naming.Name;

/**
 * 注解属性对应 ldap 协议中的属性名称
 * objectClasses 查询 ldap协议中 objectClasses 为 inetOrgPerson 的账号
 */
@Entry(objectClasses = {"inetOrgPerson"})
@Data
public class Person {

    @Id
    @JsonIgnore // 必写
    private Name distinguishedName;

    @Attribute(name = "cn")
    private String cn;

    @Attribute(name = "mail")
    private String mail;

    @Attribute(name = "gidNumber")
    private Integer gidNumber;

    @Attribute(name = "homeDirectory")
    private String homeDirectory;

    @Attribute(name = "sn")
    private String sn;

    @Attribute(name = "uidNumber")
    private Integer uidNumber;

    @Attribute(name = "sAMAccountName")
    private String loginName;

    @Attribute(name = "uid")
    private String uid;

    @Attribute(name="givenName")
    private String givenName;

}
